import java.io.*;

/**
 * @author zhangrui
 * @date 2020-04-12 21:32
 */
public class Top100 {
    private static String BEGIN = "\">";
    private static String END = "</";
    private static String FROMFILE = "12.txt";
    private static String TOFILE = "top.txt";

    public static void handle() {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(FROMFILE)),
                    "UTF-8"));
            BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(TOFILE)),
                    "UTF-8"));
            String lineTxt = null;
            while ((lineTxt = br.readLine()) != null) {
                bw.write(lineTxt.substring(lineTxt.indexOf(BEGIN)+BEGIN.length(),lineTxt.indexOf(END)));
                bw.newLine();
            }
            br.close();
            bw.close();
        } catch (Exception e) {
            System.err.println("read errors :" + e);
        }
    }


    public static void main(String[] args) {
        handle();
    }
}
